//
//  VibrationDiagnosisService.m
//  MobileChecker
//
//  Created by Lymons on 15-1-7.
//  Copyright (c) 2015年 Lymons. All rights reserved.
//

#import "VibrationDiagnosisService.h"
#import <AudioToolbox/AudioToolbox.h>

@interface VibrationDiagnosisService ()

@property (nonatomic, strong) NSTimer *timer;

@end

@implementation VibrationDiagnosisService

- (void)startCheck:(id<RACSubscriber>)subscriber
{
    self.timer = [NSTimer scheduledTimerWithTimeInterval:1.0 target:self selector:@selector(playVibrate) userInfo:nil repeats:YES];
}

- (void)endCheckOnTimer:(id<RACSubscriber>)subscriber
{
    [self.timer invalidate];
}

#pragma mark -
- (void)playVibrate
{
    AudioServicesPlaySystemSound(kSystemSoundID_Vibrate);
}

@end
